SRV=iprecorder
VERSION=0.0.1
DOCKERURL=wilsonhe2019

.PHONY: build
build: 
	go env -w CGO_ENABLED=0
	go build -a -ldflags '-extldflags "-static"' -o ${SRV} main.go
	go env -w CGO_ENABLED=1

.PHONY: docker
docker:
	docker build . -t ${SRV}:${VERSION}
	
	docker tag ${SRV}:${VERSION} ${DOCKERURL}/${SRV}:${VERSION}
	docker push ${DOCKERURL}/${SRV}:${VERSION}

start:
	go run main.go

rundocker:
	docker run ${DOCKERURL}/${SRV}:${VERSION}
